package LinkedList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2023-12-03
 * Time: 21:42
 */
public class Test {
    public static void main(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        //头插法
       /* myLinkedList.addFirst(11);
        myLinkedList.addFirst(22);
        myLinkedList.addFirst(33);
        myLinkedList.addFirst(44);
        myLinkedList.addFirst(55);*/
     /*   myLinkedList.display();*/
        //尾插法
        myLinkedList.addLast(11);
        myLinkedList.addLast(22);
        myLinkedList.addLast(33);
        myLinkedList.addLast(44);
        myLinkedList.addLast(55);
        System.out.println("插入前：");
        myLinkedList.display();
        myLinkedList.addIndex(2,66);
        System.out.println("插入后：");
        myLinkedList.display();
        System.out.println(myLinkedList.contains(22));
        System.out.println(myLinkedList.size());
    }
}
